﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MVCPets.Models.UserModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	User List
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>User List</h2>

    <table>
        <tr>
          <th></th>
          <th>Name</th>
          <th>EmailAddress</th>
          <th>Role</th>
          <th>RegistrationDate</th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
          <td>
            <%= Html.ActionLink("Edit", "Edit", new { id=item.ID }) %> |
            <%= Html.ActionLink("Details", "Details", new { id=item.ID })%> |
            <%= Html.ActionLink("Delete", "Delete", new { id=item.ID })%>
          </td>
          <td><%= item.FirstName + " " + item.LastName %></td>
          <td><%= item.EmailAddress %></td>          
          <td><%= item.RoleName %></td>
          <td><%= item.RegistrationDate.ToShortDateString() %></td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("[Create New]", "Create") %>
    </p>

</asp:Content>